package com.snb.play.dwebtoon.data;

import java.util.Iterator;

import org.json.JSONObject;

public class DTO_Episode extends JSonDataObjectBase {

	/**
	 * 
	 */
	private static final long serialVersionUID = 13023L;
	public String isReadFinish;
//	public String isSavedImg;
	public String isSavedInfo;
	public String pid;
	public String id;
//	public String episode;
	public String title;
//	public String shortTitle;
//	public ThumbnailImage thumbnailImage;
	public String thumbnailImage;

//	public String episodeImage;
//	public String encryptUseYn;
//	public String serviceStatus;
//	public String articleId;
//	public String commentUseYn;
//	public String dateCreated;
//	public String webtoon;
//	public String serviceType;
//	public String price;
//	public String padtoonImage;
//	public String payWebtoonEpisode;
//	public VoteTarget voteTarget;
	public DTO_Episode() {
		super();
	}

	public DTO_Episode(JSONObject aJsonObject) {
		@SuppressWarnings("unchecked")
		Iterator<Object> iterator = aJsonObject.keys();

		while (iterator.hasNext()) {
			Object obj = iterator.next();
			if (obj.toString().equalsIgnoreCase("voteTarget")) {
			} else if (obj.toString().equalsIgnoreCase("thumbnailImage")) {
				try {
					this.thumbnailImage = aJsonObject.getJSONObject("thumbnailImage").getString("url");
				} catch (Exception e) {
					if (isDebug)
						e.printStackTrace();
				}
			} else {
				setMemberFiled(this, aJsonObject, obj.toString());
			}
		}
		printMembers();
	}

//	public class ThumbnailImage extends JSonDataObjectBase {
//		public String id;
//		public String url;
//
//		public String name;
//		public String size;
//		public String width;
//		public String height;
//		public String mediaType;
//
//		public ThumbnailImage(JSONObject aJsonObject) {
//			// TODO Auto-generated constructor stub
//			init(aJsonObject);
//			printMembers();
//		}
//	}
//
//	public class VoteTarget extends JSonDataObjectBase {
//		public String id;
//		public String voteServiceId;
//		public String serviceTargetId;
//		public String voteCount;
//		public String ranking;
//		public String diff;
//		public String voteTotalScore;
//		public String dateCreated;
//		public String lastUpdated;
//
//		public VoteTarget(JSONObject aJsonObject) {
//			// TODO Auto-generated constructor stub
//			init(aJsonObject);
//
//			printMembers();
//			insertObjToDB();
//		}
//	}
}
